<?php
/**
 * Created by PhpStorm.
 * User: 周超
 * Date: 2016/11/17
 * Time: 17:50
 */

namespace App\Http\Routes;

use Illuminate\Contracts\Routing\Registrar;
class ModuleBackRoute
{
    public function map(Registrar $router)
    {
        $router->group(['middleware' =>   ['web','auth','permissions.check','permissions.check'],
            'prefix' => 'backstage/module',], function ($router) {
            $router->get('module-list',['uses' =>'Backstage\ModuleController@getModuleList'])->name('get.module.module-list');
            $router->post('show', ['uses' => 'Backstage\ModuleController@postShow'])->name('post.module.module-list.show');
            $router->post('delete', ['uses' => 'Backstage\ModuleController@postDelete'])->name('post.module.module-list.delete');
            $router->post('update-sort', ['uses' => 'Backstage\ModuleController@postUpdateSort'])->name('post.module.module-list.update-sort');
            $router->get('add-module', ['uses' => 'Backstage\ModuleController@getAddModule'])->name('get.module.module-list.add-module');
            $router->post('add-module', ['uses' => 'Backstage\ModuleController@postAddModule'])->name('post.module.module-list.add-module');
            $router->get('add-data/{id}', ['uses' => 'Backstage\ModuleController@getAddData'])->name('get.module.module-list.add-data');
            $router->post('add-data', ['uses' => 'Backstage\ModuleController@postAddData'])->name('post.module.module-list.add-data');
            $router->get('data-list/{id}', ['uses' => 'Backstage\ModuleController@getDataList'])->name('get.module.module-list.data-list');
            $router->post('search',['uses' =>'Backstage\TypesController@postSearch'])->name('post.module.module-list.search');
            $router->post('search-user', ['uses' => 'Backstage\ModuleController@postSearchUser'])->name('post.module.module-list.search-user');
            $router->get('delete-resource/{module_id}/{resource_id}', ['uses' => 'Backstage\ModuleController@getDeleteResource'])->name('get.module.module-list.delete-resource');
            $router->get('update/{module_id}', ['uses' => 'Backstage\ModuleController@getUpdate'])->name('get.module.module-list.update');
            $router->post('update', ['uses' => 'Backstage\ModuleController@postUpdate'])->name('post.module.module-list.update');
            $router->post('search-categorys', ['uses' => 'Backstage\ModuleController@postSearchCategorys'])->name('post.module.module-list.search-categorys');
            $router->post('update-resource-sort', ['uses' => 'Backstage\ModuleController@postUpdateResourceSort'])->name('post.module.module-list.update-resource-sort');
        });
    }
}